package com.synnex.mobile.servier.core.actRecord.bo;

import com.synnex.mobile.generic.core.util.ObjectUtil;
import com.synnex.mobile.servier.core.actRecord.dto.ActivityRecord;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: kerryf
 * To change this template use File | Settings | File Templates.
 */
public class ActivityRecordBo {
    protected Integer id;
    protected String title;
    protected String path;
    protected Integer seq;
    protected Date activityDay;
    protected String type;
    protected String category;
    protected Integer folderId;
    protected String folderName;


    protected Date entryDate;
    protected Date updateDate;

    public String getFolderName() {
        return folderName;
    }

    public void setFolderName(String folderName) {
        this.folderName = folderName;
    }

    public Integer getFolderId() {
        return folderId;
    }

    public void setFolderId(Integer folderId) {
        this.folderId = folderId;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Integer getSeq() {
        return seq;
    }

    public void setSeq(Integer seq) {
        this.seq = seq;
    }

    public Date getEntryDate() {
        return entryDate;
    }

    public void setEntryDate(Date entryDate) {
        this.entryDate = entryDate;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public Date getActivityDay() {
        return activityDay;
    }

    public void setActivityDay(Date activityDay) {
        this.activityDay = activityDay;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public static ActivityRecordBo createInstance(ActivityRecord record){

        if(record!=null){
            return ObjectUtil.copyProperties(record, ActivityRecordBo.class);
        }else{
            return new ActivityRecordBo();
        }
    }

    public static List<ActivityRecordBo> createInstance(List<ActivityRecord> records){

        List<ActivityRecordBo> recordBos = new ArrayList<ActivityRecordBo>();
        if (records != null) {
            for (ActivityRecord data : records) {
                recordBos.add(createInstance(data));
            }
        }
        return recordBos;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("id: ").append(this.id).append("; title: ").append(this.getTitle()).append("; category").append(this.category);
        return sb.toString();
    }
}
